# -*- coding: utf-8 -*-
from datetime import timedelta

from utils.operators.spark_submit import SparkSubmitOperator

from jms.dm.route.dm_route_branch_in import dm__dm_route_branch_in
from jms.dm.route.dm_route_branch_out import dm__dm_route_branch_out
from jms.dm.route.dm_route_main_two import dm__dm_route_main_two

dm__dm_route_whole_huaxi_base = SparkSubmitOperator(
    conn_id='spark_route',
    task_id='dm__dm_route_whole_huaxi_base',
    email=['zhangqinglin@jtexpress.com','yl_bigdata@yl-scm.com'],
    pool_slots=6,
    name='dm__dm_route_whole_huaxi_base',
    driver_memory='10G',
    executor_memory='6G',
    executor_cores=4,
    num_executors=40,
    jars='hdfs:///route/package/graphframes-0.7.0-spark2.3-s_2.11.jar,hdfs:///route/package/common-1.0-SNAPSHOT.jar',
    java_class='com.yunlu.bigdata.jobs.route.export.WholeRouteExportReorgnized',
    application='hdfs:///route/package/original-jobs-1.0-SNAPSHOT.jar',
    application_args=['{{ execution_date | cst_ds }}', 'huaxi','100'],
    execution_timeout=timedelta(hours=2),
)

dm__dm_route_whole_huaxi_base << [dm__dm_route_branch_in,
                             dm__dm_route_branch_out,
                             dm__dm_route_main_two, ]
